<?php
//测试专用
Route::group(['prefix'=>'/test/'],function(){
    //test/index
    Route::get('/','OA\TestController@index');
    Route::post('/excel','OA\TestController@excelImport');
});


//login
Route::get('login','OA\LoginController@login');
//check_login
Route::post('checkLogin','OA\LoginController@checkLogin');
//home
Route::get('home','OA\HomeController@index');

//input
Route::get('companys','OA\InputController@companys');

//通过公司获取部门信息
Route::post('getDepts','OA\InputController@getDepts');

//文件上传测试
Route::any('uploadFiles','OA\FilesController@uploadFiles');


//币种相关
Route::group(['prefix'=>'/currency/'],function(){
    Route::any('list','OA\CurrencyController@currencyList');//币种列表
    Route::post('editRate','OA\CurrencyController@editRate');//币种修改
});

//部门设置
Route::group(['prefix'=>'/dept/'],function(){
    Route::any('list','OA\DeptController@deptList');//部门列表
    Route::post('editDept','OA\DeptController@editDept');//部门修改
    Route::post('addDept','OA\DeptController@addDept');//新增部门
});

//用户相关
Route::group(['prefix'=>'/user/'],function(){
    Route::any('list','OA\UserController@userList');//用户列表
    Route::post('editUser','OA\UserController@editUser');//修改用户
});

//城市相关
Route::group(['prefix'=>'/city/'],function(){
    Route::any('list','OA\CityController@cityList');//城市列表
    Route::post('editCity','OA\CityController@editCity');//城市修改
});


//流程相关
Route::group(['prefix'=>'/work/'],function(){

    Route::any('list','OA\WorkController@workList');//流程列表

    Route::post('editWork','OA\WorkController@editWork');//流程修改

    Route::post('addWork','OA\WorkController@addWork');//新增流程

    Route::get('work_detail','OA\WorkController@workDetail');//流程详情

});

//测试多线程
Route::group(['prefix'=>'/test/'],function(){
        Route::any('pool','OA\TestController@Pool')->name('oa.pool');
});

//common Input
Route::group(['prefix'=>'/common/'],function(){
    //下拉框,公共
    Route::any('input','OA\CommonController@getInput')->name('oa.input');
    //获取职位列表
    Route::any('position_list','OA\CommonController@getPositionList');

    //通过职位获取用户

    Route::get('getUserList','OA\CommonController@getUserListByPositionId');

    //获取所有用户+职位
    Route::get('getAllRoleAndUser','OA\CommonController@getAllRoleAndUser');//id->title

    //获取公司部门
    Route::get('getCompanyDept','OA\CommonController@getCompanyDept');

});

//员工相关
Route::group(['prefix'=>'/staff/'],function(){
    //获取员工列表
    Route::get('list','OA\StaffController@getStaffList');
    //批量删除
    Route::post('batch_del','OA\StaffController@BatchDelete');
    //获取用户详情
    Route::get('staff_info','OA\StaffController@StaffInfo');
    //编辑用户
    Route::post('staff_edit','OA\StaffController@StaffEdit');

    //获取员工职位,角色
    Route::get('staff_position_role','OA\StaffController@StaffPositionRole');
});

//权限相关
Route::group(['prefix'=>'/auth/'],function(){
    //通过职位获取权限
    Route::get('list','OA\AuthController@getAuthListByPositionId');
});

//工具
Route::group(['prefix'=>"/tool/"],function(){
    //上传图像
    Route::post('upload_file','OA\ToolController@uploadFile');
});

//项目
Route::group(['prefix'=>"/project/"],function(){
    //立项
    Route::post('addProject','OA\ProjectController@addProject');

    //立项数据
    Route::get('getProjectLx','OA\ProjectController@getProjectLx');

    //立项数据详情
    Route::get('projectDetail','OA\ProjectController@projectDetailLx');

    //编辑立项数据
    Route::post('editProjectLx','OA\ProjectController@editProjectLx');

    //编辑预算数据
    Route::post('editProjectYs','OA\ProjectController@editProjectYs');

    //修改供应商
    Route::post('editProjectPartner','OA\ProjectController@editProjectPartner');

    //预算数据列表
    Route::get('getYsList','OA\ProjectController@getYsList');

    //获取项目基本信息
    Route::get('projectBase','OA\ProjectController@getProjectBaseInfo');

    //添加预算数据
    Route::post('addProjectYs','OA\ProjectController@addProjectYs');

});

//职位管理
Route::group(['prefix'=>"/position/"],function(){
    Route::get('list','OA\PositionController@getPositionList');
});


//公司管理
Route::group(['prefix'=>"/company/"],function(){
    //获取公司列表
    Route::get('list','OA\CompanyController@getCompanyList');

    Route::post('edit','OA\CompanyController@editCompany');

    Route::post('del','OA\CompanyController@delCompany');


});

//审批记录
Route::group(['prefix'=>"/log/"],function(){
    //添加审批日志记录
    Route::post('add','OA\ShenPiLogController@addShenPiLog');

});

//修改项目流程
Route::post('editProjectState','OA\ShenPiLogController@editProjectState');

//获取待审数目
Route::get('getWaitProject','OA\ProjectMasterController@getWaitProject');




